/*
 * Copyright (c) 2023 huipei.x
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.xphsc.kubernetes.core.query;

import io.kubernetes.client.custom.V1Patch;
/**
 * {@link }
 * @author <a href="xiongpeih@163.com">huipei.x</a>
 * @description: Patch Body
 * @since 1.0.0
 */
public class PatchNamespaceBody {
    /**
     * namespace object name and auth scope, such as for teams and projects (required)
     */
    private String namespace;
    /**
     * name of the Namespace (required)
     */
    private String name;
    /**
     * body (required)
     */
    private V1Patch body;
    /**
     * pretty If &#39;true&#39;, then the output is pretty printed. (optional)
     */
    private String pretty;
    /**
     * When present, indicates that modifications should not be persisted. An invalid or
     * unrecognized dryRun directive will result in an error response and no further processing of
     *  the request. Valid values are: - All: all dry run stages will be processed (optional)
     */
    private String dryRun;
    /**
     * fieldManager is a name associated with the actor or entity that is making
     *  these changes. The value must be less than or 128 characters long, and only contain
     *  printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is
     *  required for apply requests (application/apply-patch) but optional for non-apply patch
     *  types (JsonPatch, MergePatch, StrategicMergePatch). (optional)
     */
    private String fieldManager;
    /**
     * fieldValidation instructs the server on how to handle objects in the
     *   request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the
     * &#x60;ServerSideFieldValidation&#x60; feature gate is also enabled. Valid values are: -
     * Ignore: This will ignore any unknown fields that are silently dropped from the object, and
     *   will ignore all but the last duplicate field that the decoder encounters. This is the
     *  default behavior prior to v1.23 and is the default behavior when the
     *  &#x60;ServerSideFieldValidation&#x60; feature gate is disabled. - Warn: This will send a
     * warning via the standard warning response header for each unknown field that is dropped
     * from the object, and for each duplicate field that is encountered. The request will still
     *   succeed if there are no other errors, and will only persist the last of any duplicate
     *   fields. This is the default when the &#x60;ServerSideFieldValidation&#x60; feature gate is
     *   enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields
     *   would be dropped from the object, or if any duplicate fields are present. The error
     *   returned from the server will contain all unknown and duplicate fields encountered.
     *    (optional)
     */
    private String fieldValidation;
    /**
     * Force is going to \&quot;force\&quot; Apply requests. It means user will
     *  re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply
     *   patch requests. (optional)
     */
    private Boolean force;

    public static PatchNamespaceBody.Builder builder() {
        return new PatchNamespaceBody.Builder();
    }

    private PatchNamespaceBody(PatchNamespaceBody.Builder builder) {
        this.namespace = builder.namespace;
        this.name = builder.name;
        this.body = builder.body;
        this.pretty = builder.pretty;
        this.dryRun = builder.dryRun;
        this.fieldManager = builder.fieldManager;
        this.fieldValidation = builder.fieldValidation;
        this.force = builder.force;

    }


    public static class Builder {
        private String namespace;
        private String name;
        private V1Patch body;
        private String pretty;
        private String dryRun;
        private String fieldManager;
        private String fieldValidation;
        private Boolean force;


        public Builder() {
        }
        /**
         * namespace object name and auth scope, such as for teams and projects (required)
         */
        public <T> PatchNamespaceBody.Builder namespace(String namespace) {
            this.namespace = namespace;
            return this;
        }
        /**
         * name of the Namespace (required)
         */
        public <T> PatchNamespaceBody.Builder name(String name) {
            this.name = name;
            return this;
        }
        /**
         * body (required)
         */
        public <T> PatchNamespaceBody.Builder body(V1Patch body) {
            this.body = body;
            return this;
        }
        /**
         * pretty If &#39;true&#39;, then the output is pretty printed. (optional)
         */
        public <T> PatchNamespaceBody.Builder pretty(String pretty) {
            this.pretty = pretty;
            return this;
        }
        /**
         * When present, indicates that modifications should not be persisted. An invalid or
         * unrecognized dryRun directive will result in an error response and no further processing of
         *  the request. Valid values are: - All: all dry run stages will be processed (optional)
         */
        public <T> PatchNamespaceBody.Builder dryRun(String dryRun) {
            this.dryRun = dryRun;
            return this;
        }
        /**
         * fieldManager is a name associated with the actor or entity that is making
         *  these changes. The value must be less than or 128 characters long, and only contain
         *  printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is
         *  required for apply requests (application/apply-patch) but optional for non-apply patch
         *  types (JsonPatch, MergePatch, StrategicMergePatch). (optional)
         */
        public <T> PatchNamespaceBody.Builder fieldManager(String fieldManager) {
            this.fieldManager = fieldManager;
            return this;
        }
        /**
         * fieldValidation instructs the server on how to handle objects in the
         *   request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the
         * &#x60;ServerSideFieldValidation&#x60; feature gate is also enabled. Valid values are: -
         * Ignore: This will ignore any unknown fields that are silently dropped from the object, and
         *   will ignore all but the last duplicate field that the decoder encounters. This is the
         *  default behavior prior to v1.23 and is the default behavior when the
         *  &#x60;ServerSideFieldValidation&#x60; feature gate is disabled. - Warn: This will send a
         * warning via the standard warning response header for each unknown field that is dropped
         * from the object, and for each duplicate field that is encountered. The request will still
         *   succeed if there are no other errors, and will only persist the last of any duplicate
         *   fields. This is the default when the &#x60;ServerSideFieldValidation&#x60; feature gate is
         *   enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields
         *   would be dropped from the object, or if any duplicate fields are present. The error
         *   returned from the server will contain all unknown and duplicate fields encountered.
         *    (optional)
         */
        public <T> PatchNamespaceBody.Builder fieldValidation(String fieldValidation) {
            this.fieldValidation = fieldValidation;
            return this;
        }
        /**
         * Force is going to \&quot;force\&quot; Apply requests. It means user will
         *  re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply
         *   patch requests. (optional)
         */
        public <T> PatchNamespaceBody.Builder force(Boolean force) {
            this.force = force;
            return this;
        }


        public PatchNamespaceBody build() {
            return new PatchNamespaceBody(this);
        }
    }

    public String namespace() {
        return namespace;
    }

    public String name() {
        return name;
    }

    public V1Patch body() {
        return body;
    }

    public String pretty() {
        return pretty;
    }

    public String dryRun() {
        return dryRun;
    }

    public String fieldManager() {
        return fieldManager;
    }

    public String fieldValidation() {
        return fieldValidation;
    }

    public Boolean force() {
        return force;
    }
}
